import { createApp } from 'vue'
import 'element-plus/dist/index.css'
import './style.css'
import App from './App.vue'
/* 
 * 1.如果默认引用index.js文件，则默认不用写文件名，只需要写文件夹名，否则需要补全文件名。
 * 2.导入时，如果被导入方只有一个导出对象，则无需使用大括号。
 * 3. ./：同级目录；../：上级目录；@/：根目录；~：相对目录
 * 4.如需要将根目录指向src目录，则需要在vite.config.js中配置
 */
import router from './router' 
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { createPinia } from "pinia";
import piniaPluginPersist from "pinia-plugin-persist";
import * as ElIcons from '@element-plus/icons-vue'

const app = createApp(App);

app.use(ElementPlus, {
  locale: zhCn
})

for (const [key, component] of Object.entries(ElIcons)) {
  app.component(key, component);
}

app.use(router)

let pi = createPinia().use(piniaPluginPersist);
app.use(pi);

app.mount('#app')
